/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jpa.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author julio
 */
@Entity
@Table(name = "stops_times")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "StopsTimes.findAll", query = "SELECT s FROM StopsTimes s"),
    @NamedQuery(name = "StopsTimes.findByTripId", query = "SELECT s FROM StopsTimes s WHERE s.stopsTimesPK.tripId = :tripId"),
    @NamedQuery(name = "StopsTimes.findByArrivalTime", query = "SELECT s FROM StopsTimes s WHERE s.arrivalTime = :arrivalTime"),
    @NamedQuery(name = "StopsTimes.findByDepartureTime", query = "SELECT s FROM StopsTimes s WHERE s.departureTime = :departureTime"),
    @NamedQuery(name = "StopsTimes.findByStopId", query = "SELECT s FROM StopsTimes s WHERE s.stopsTimesPK.stopId = :stopId"),
    @NamedQuery(name = "StopsTimes.findByStopSequence", query = "SELECT s FROM StopsTimes s WHERE s.stopSequence = :stopSequence"),
    @NamedQuery(name = "StopsTimes.findByStopHeadsign", query = "SELECT s FROM StopsTimes s WHERE s.stopHeadsign = :stopHeadsign"),
    @NamedQuery(name = "StopsTimes.findByPickupType", query = "SELECT s FROM StopsTimes s WHERE s.pickupType = :pickupType"),
    @NamedQuery(name = "StopsTimes.findByDropOffType", query = "SELECT s FROM StopsTimes s WHERE s.dropOffType = :dropOffType"),
    @NamedQuery(name = "StopsTimes.findByShapeDistTraveled", query = "SELECT s FROM StopsTimes s WHERE s.shapeDistTraveled = :shapeDistTraveled")})
public class StopsTimes implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected StopsTimesPK stopsTimesPK;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 8)
    @Column(name = "arrival_time")
    private String arrivalTime;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 8)
    @Column(name = "departure_time")
    private String departureTime;
    @Basic(optional = false)
    @NotNull
    @Column(name = "stop_sequence")
    private int stopSequence;
    @Size(max = 45)
    @Column(name = "stop_headsign")
    private String stopHeadsign;
    @Size(max = 2)
    @Column(name = "pickup_type")
    private String pickupType;
    @Size(max = 2)
    @Column(name = "drop_off_type")
    private String dropOffType;
    @Size(max = 45)
    @Column(name = "shape_dist_traveled")
    private String shapeDistTraveled;

    public StopsTimes() {
    }

    public StopsTimes(StopsTimesPK stopsTimesPK) {
        this.stopsTimesPK = stopsTimesPK;
    }

    public StopsTimes(StopsTimesPK stopsTimesPK, String arrivalTime, String departureTime, int stopSequence) {
        this.stopsTimesPK = stopsTimesPK;
        this.arrivalTime = arrivalTime;
        this.departureTime = departureTime;
        this.stopSequence = stopSequence;
    }

    public StopsTimes(String tripId, String stopId) {
        this.stopsTimesPK = new StopsTimesPK(tripId, stopId);
    }

    public StopsTimesPK getStopsTimesPK() {
        return stopsTimesPK;
    }

    public void setStopsTimesPK(StopsTimesPK stopsTimesPK) {
        this.stopsTimesPK = stopsTimesPK;
    }

    public String getArrivalTime() {
        return arrivalTime;
    }

    public void setArrivalTime(String arrivalTime) {
        this.arrivalTime = arrivalTime;
    }

    public String getDepartureTime() {
        return departureTime;
    }

    public void setDepartureTime(String departureTime) {
        this.departureTime = departureTime;
    }

    public int getStopSequence() {
        return stopSequence;
    }

    public void setStopSequence(int stopSequence) {
        this.stopSequence = stopSequence;
    }

    public String getStopHeadsign() {
        return stopHeadsign;
    }

    public void setStopHeadsign(String stopHeadsign) {
        this.stopHeadsign = stopHeadsign;
    }

    public String getPickupType() {
        return pickupType;
    }

    public void setPickupType(String pickupType) {
        this.pickupType = pickupType;
    }

    public String getDropOffType() {
        return dropOffType;
    }

    public void setDropOffType(String dropOffType) {
        this.dropOffType = dropOffType;
    }

    public String getShapeDistTraveled() {
        return shapeDistTraveled;
    }

    public void setShapeDistTraveled(String shapeDistTraveled) {
        this.shapeDistTraveled = shapeDistTraveled;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (stopsTimesPK != null ? stopsTimesPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StopsTimes)) {
            return false;
        }
        StopsTimes other = (StopsTimes) object;
        if ((this.stopsTimesPK == null && other.stopsTimesPK != null) || (this.stopsTimesPK != null && !this.stopsTimesPK.equals(other.stopsTimesPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "jpa.entities.StopsTimes[ stopsTimesPK=" + stopsTimesPK + " ]";
    }
    
}
